const path = require('path')
const resolve = dir => path.join(__dirname, dir)

module.exports = {
    outputDir: 'dist',   // build输出目录
    assetsDir: 'assets', // 静态资源目录（js, css, img）
    lintOnSave: true, // 是否开启eslint
    chainWebpack: config => {
        // 设置快捷路径
        config.resolve.alias
        .set('@', resolve('src'))
        .set('assets', resolve('src/assets'))
        .set('components', resolve('src/components'))
        .set('views', resolve('src/views'))
    },
    // 代理 
	devServer: {
		proxy: {
			'/api': {
				target: 'http://app1.naoffer.com',
				ws: true,
				changeOrigin: true,
				secure: false,
				pathRewrite: {
					'^/api': '' // 路径重写
				}
			},
        },
    }
}
